package cn.glinks.liuhe.activity;

import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.OnClick;
import cn.glinks.liuhe.R;
import cn.glinks.liuhe.base.BaseActivity;
import cn.glinks.liuhe.utils.ActTransAnimUtils;

/**
 * Des:《用户注册服务协议》页面
 *
 * @author MarsBlade of Cyh
 * @created 2017-03-21 14:43
 */
public class AgreementActivity extends BaseActivity {

    @BindView(R.id.tv_title)
    TextView mTitleText;

    @Override
    public int getLayoutId() {
        return R.layout.activity_agreement;
    }

    @Override
    public void initView(Bundle savedInstanceState) {
        // 设置为透明状态栏
        SetTranslanteBar();
        // 初始化标题
        mTitleText.setText("用户注册服务协议");
    }

    /*--------------------------------------------------------------------------------
     *                          点击事件接口实现
     ---------------------------------------------------------------------------------*/
    // 注册并登录
    @OnClick(R.id.tv_agree)
    public void clickAgree() {
        // 返回注册界面
        ActTransAnimUtils.finishActionPushUp(AgreementActivity.this);
    }

    /**
     * 监听主页键,返回键
     *
     * @param keyCode
     * @param event
     * @return
     */
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            // 返回注册界面
            ActTransAnimUtils.finishActionPushUp(AgreementActivity.this);
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }

}
